#/usr/bin/python
#coding:utf-8

import MySQLdb

createSql = "CREATE TABLE users(login VARCHAR(8), uid INT);"
con = MySQLdb.connect(user="larry",db="test")
cur = con.cursor()
cur.execute("INSERT INTO users VALUES('john',1000)")
cur.execute("INSERT INTO users VALUES('larry',1001)")
cur.execute("INSERT INTO users VALUES('mary',1002)")
cur.execute("INSERT INTO users VALUES('lili',1003)")
cur.execute("INSERT INTO users VALUES('lilei',1004)")
cur.execute("SELECT * FROM users")
for user in cur.fetchall():
    print '%s\t%s' % user
con.commit()
con.close()
